home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / Draw / Sources / PalFrame.h < prev    next >
Encoding:
Text File  |  1996-08-16  |  2.7 KB  |  99 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                PalFrame.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Author:                Henri Lamiraux
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef PALFRAME_H
  13. #define PALFRAME_H
  14.  
  15. // ----- OS Layer -----
  16.  
  17. #ifndef FLOATFRM_H
  18. #include "FloatFrm.h"
  19. #endif
  20.  
  21. //========================================================================================
  22. // Forward Declaration
  23. //========================================================================================
  24.  
  25. class FW_CFacetContext;
  26. class FW_CColor;
  27. class FW_CMouseEvent;
  28.  
  29. class CGrid;
  30.  
  31. //========================================================================================
  32. // CPalette
  33. //========================================================================================
  34.  
  35. class CPalette
  36. {
  37. //----------------------------------------------------------------------------------------
  38. // Initialization/destruction
  39. //
  40. public:        
  41.     CPalette();
  42.     virtual ~ CPalette();
  43.  
  44. //----------------------------------------------------------------------------------------
  45. // New API
  46. //
  47. public:
  48.     void    GetColor(short colorIndex, FW_CColor* color) const;
  49.     short    NumberOfColors() const
  50.                 {return fNumbersOfColors;}
  51.  
  52. //----------------------------------------------------------------------------------------
  53. // Data Members
  54. //
  55. private:
  56.     short            fNumbersOfColors;
  57. #ifdef FW_BUILD_MAC
  58.     CTabHandle        fColorTable;
  59. #endif
  60. #ifdef FW_BUILD_WIN
  61.     PALETTEENTRY*    fColorTable;
  62. #endif
  63. };
  64.  
  65. //========================================================================================
  66. // CPaletteFrame
  67. //========================================================================================
  68.  
  69. class CPaletteFrame : public CFloatingWindowFrame
  70. {
  71. //----------------------------------------------------------------------------------------
  72. // Initialization/destruction
  73. //
  74. public:        
  75.  
  76.     FW_DECLARE_AUTO(CPaletteFrame)
  77.     
  78.     CPaletteFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CDrawPart* drawPart);
  79.     virtual ~ CPaletteFrame();
  80.  
  81. //----------------------------------------------------------------------------------------
  82. // Inherited API
  83. //
  84. public:        
  85.     virtual void             Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  86.     virtual FW_Boolean        DoMouseDown(Environment* ev, const FW_CMouseEvent& theMouseEvent);
  87.  
  88.     virtual void            FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
  89.     
  90. //----------------------------------------------------------------------------------------
  91. // Data Members
  92. //
  93. private:
  94.     CPalette*                fPalette;
  95.     CGrid                    *fGrid;
  96. };
  97.  
  98. #endif
  99.